/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  //超限模版审核
  'POST /CustomerService/getWaitForApproveTemplate': (req: Request, res: Response) => {
    const data = {
      4644: {
        cmId: '',
        cmPhone: '1',
        content: '2',
        createTime: '',
      },
      5405: {
        cmId: '',
        cmPhone: '1',
        content: '2',
        createTime: '',
      },
    };
    const result = {
      code: 0,
      msg: 'success',
      data,
    };
    return res.json(result);
  },
  'POST /CustomerService/artificialDealTemplate': (req: Request, res: Response) =>
    responseSuccess(req, res),

  //短信模版查询
  'POST /CustomerServiceV2/templateQuery': (req: Request, res: Response) => {
    const data = Mock.mock({
      'retList|1-10': [
        {
          tid: '@id()',
          cm_phone: '@id()',
          apply_time: '@now()',
          content: '@id()',
          cm_id: '@id()',
          id: '@id()',
          kb_id: '@id()',
          'status|0-1': 0,
          sms_supplier: '@cname()',
          send_time: '@now()',
          report_time: '@now()',
          'kb_type|1': ['s', 'yz', '', null],
          'is_black|1': [0, 1],
          'Deduct|1': [0, 1],
          'state|1': ['状态1', '状态2'],
          'isShield|1': [-1, 0, 1],
          'isBlack|1': [-1, 0, 1],
        },
      ],
    });
    const result = {
      code: 0,
      msg: 'success',
      data: {
        retList: data.retList,
        total_records: data.retList.length,
      },
    };
    return res.json(result);
  },
  'POST /Shield/addSMSBlack': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Shield/black': (req: Request, res: Response) => responseSuccess(req, res),

  //添加敏感词
  'POST /SmsSensitiveWords/getList': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-10': [
        {
          id: '@id()',
          sensitive_words: '@cname()',
          admin_name: '@cname()',
          create_time: '@now()',
        },
      ],
    });
    const result = {
      code: 0,
      msg: 'success',
      data: {
        list: data.list,
        count: data.list.length,
      },
    };
    return res.json(result);
  },
  'POST /SmsSensitiveWords/deleteSensitiveWord': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /SmsSensitiveWords/addSensitiveWord': (req: Request, res: Response) =>
    responseSuccess(req, res),
};
